using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace FU.Capstones.IMS.Web.Common.Converters
{
    public class InverseBoolToVisibilityConverter : IValueConverter
    {
        #region Implementation of IValueConverter

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            bool? btemp = (bool?) value;
            if (btemp == true)
            {
                return Visibility.Collapsed;
            }
            return Visibility.Visible;

            //return btemp ? Visibility.Collapsed : Visibility.Visible;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}